package com.dualPointer;

public class MoveZeroes0202_283 {
    public void moveZeroes(int[] nums){
        int m= 0, r = 0;
        while (r < nums.length){
            if(nums[r] == 0){
                m++;
            }else {
                nums[r-m] = nums[r];
            }
            r++;
        }
        for (int i = nums.length - m; i < nums.length; i++) {
            nums[i] = 0;
        }
    }
}
